import axios from '@/libs/request/axios'


// 获取开票方数据 多条件
export const getDrawerPartyData = (params) => {
    return axios.request({
        url: '/channel/drawerParty/getByCondition',
        data:params,
        method: 'post'
    })
}

// 根据id获取开票方数据
export const getDrawerPartyById = (id,carDealerId,params) => {
    return axios.request({
        url: `/channel/drawerParty/getDrawerPartyById/${id}/${carDealerId}`,
        params:params,
        method: 'get'
    })
}

// 添加开票方
export const saveDrawerPartyData = (params) => {
    return axios.request({
        url: '/channel/drawerParty/saveOrUpdateDrawerParty',
        data:params,
        method: 'post'
    })
}
//编辑开票方
export const editCarDealerData = (params) => {
    return axios.request({
        url: '/channel/carDealer/editCarDealer',
        data:params,
        method: 'post'
    })
}

//禁用开票方
export const disableDrawerParty = (ids, params) => {
    return axios.request({
        url:`/channel/drawerParty/disableDrawerParty/${ids}`,
        params:params,
        method: 'get'
    })
}

//获取全部的SP和总对总合作商
export const getAllSPChannels = (params) => {
    return axios.request({
        url: '/channel/drawerParty/getAllSPChannels',
        data:params,
        method: 'post'
    })
}

//通过渠道id获取对应的车商
export const getCarDealerByChannelId = (id, params) => {
    return axios.request({
        url:`/channel/drawerParty/getCarDealerByChannelId/${id}`,
        params:params,
        method: 'get'
    })
}

//通过渠道id获取对应的sp名称
export const getChannelInfobyChannelId = (id, params) => {
    return axios.request({
        url:`/channel/drawerParty/getChannelInfobyChannelId/${id}`,
        params:params,
        method: 'get'
    })
}

// 删除开票方
export const deleteDrawerParty = (id, params) => {
    return axios.request({
        url:`/channel/drawerParty/delByIds/${id}`,
        params:params,
        method: 'delete'
    })
}




